<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/sale/include/common-base.jsp"%>
  <title>私募债管理-${titleName }</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>

<!-- Part 一、 以下是body主体内容的模块区域 -->
<body class="hold-transition skin-yellow sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left.jsp" %>
  <!-- left end-->

  <div class="content-wrapper">
    <!-- Main start -->
	<section class="content">
      <div class="row">
        <div class="col-xs-12">
        
          <!------搜索  start ------->
          <div class="box box-info">
             <!--搜索title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-search"></i> 私募债搜索</h3>
              </div>
            <!--搜索title  end --> 
            <div class="box-body">
			  <form id="searchForm" class="form-horizontal">
				<input type="hidden" name="pageName" value="financial-reg-list">
				<input type="hidden" name="formName" value="searchForm">
				<input type="hidden" name="trpProduct.w_sysName" value="${sysName }">
				
				<div class="form-group">
					<div class="form-group col-sm-2 text_r"><label class="control-label" >产品名称：</label></div>
					<div class="form-group col-sm-3">
						<input type="text" class="form-control clean"  name="trpProduct.wl_proName" value=""/>
					</div>
					<div class="form-group col-sm-2 text_r"><label class="control-label" >产品代码：</label></div>
					<div class="form-group col-sm-3">
						<input type="text" class="form-control clean"  name="trpProduct.wl_proNo" value=""/>
					</div>
				</div>
				
				<center>
				   <div class="form-group col-sm-12 box-footer clearfix">
				       <button type="button" class="btn btn-success" onclick="getTableData();"><i class="fa fa-edit-circle"></i> 查询</button> 
				       <button type="button" class="btn btn-warning" onclick="mytools.cleanData('#searchForm');">重置 </button>
				   </div>
				</center>
				
			  </form>
            </div>
	     </div>
	     <!------- 搜索 end -------->
           
        <!------- 列表 start -------->
          <div class="box box-success">
            <!--列表title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-user"></i> 私募债列表 
                 　　　              <button  onclick="toAdd();" class="btn btn-success" type="button"><i class="fa fa-plus-circle"></i> 增加 </button>
                 </h3>
              </div>
            <!--列表title  end --> 
              <div class="box-body">
                <table id="dataList" class="table table-bordered table-hover" >
                <thead class="bg-success">
                <tr>
						<th name="trpProduct.proName">产品名称</th>
						<th name="trpProduct.proNo">产品代码</th>
						<th name="trpProduct.cateName">品种类型</th>
						<th name="trpProduct.proCanal">渠道</th>
						<th name="trpProduct.proRemark">产品描述</th>
                  		<th>操作</th>
                </tr>
                </thead>
                <tbody id="dataList-body">
                </tbody>
              </table>
              <center>
    	  		<ul id="dataList-page"></ul>
              </center>
            </div>
           </div>
        <!------- 列表 end -------->
        </div>
      </div>
    </section>
    <!-- Main end -->
  </div>
  <!-- /.content-wrapper -->
  <!-- foot start -->
  <%@include file="/common/sale/foot.jsp" %>
  <!-- foot start -->
  

<div win-title="添加窗口" class="modal fade" id="my_modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:1100px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">私募债信息添加</font> 
						</h4>
					</div>

					<div class="modal-body">
						
					       <div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="myTab-add">
					            </ul>
					              
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					               <div class="tab-pane active" id="tabAdd_1">
					                  <form class="form-horizontal addFormBody" role="form" id="addForm1" action="javascript:void(0)">
					                    <input type="hidden" name="pageName" value="financial-reg-list"/>
										<input type="hidden" name="formName" value="addForm"/>
									    <input type="hidden" class="formToken" id="addForm1_formToken" name="formToken" />
										<input type="hidden" id="trpProductId"name="trpProduct.proStatus" value="1">
							            <!--trpProduct start-->
										<input type="hidden" name="trpProduct.delStatus" value="F"/><!--模板自带-->
										<input type="hidden" name="trpProduct.sysName" value="${sysName }"><!--模板自带-->
										<input type="hidden" name="trpProduct.cateName" id="addForm1_trpProduct_cateName" value=""><!--所属品种-->
										<input type="hidden" name="trpProduct.cateNo" id="addForm1_trpProduct_cateNo" value=""><!--品种编号-->
										<input type="hidden" name="trpProduct.proType" id="addForm1_trpProduct_proType" value=""><!--产品类型-->
										<input type="hidden" name="trpProduct.proId" id="addForm1_trpProduct_proId" value=""><!--主键-->
										<input type="hidden" name="trpProduct.sysName" id="addForm1_trpProduct_sysName" value="${sysName }"><!--所属系统-->
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">债券名称</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">发行人</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">本期债券代码</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">发行总额</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">票面面额</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">发行价格</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">债券期限(年)</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">发行方式</label>
												<div class="col-sm-4 ">
													<select style="width:300px; text-align: center;" class="form-control clean">
														<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
														<option>公开发行</option>
														<option>非公开发行</option>
													</select>
										 		</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">发行对象</label>
												<div class="col-sm-4 ">
										    		<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
										 		</div>
												<label  class="col-sm-2 control-label">发行安排</label>
												<div class="col-sm-4 ">
													<select style="width:300px; text-align: center;" class="form-control clean">
														<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
														<option>一次发行</option>
														<option>分期发行</option>
													</select>
										 		</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">发行开始时间</label>
												<div class="col-sm-4 input-append date form_datetime">
										    		<input style="width:88%" id="form1_saleDateStart" data-name="trsSale.saleDateStart" name="trsSale.saleDateStart" type="text" class="form-control datepicker" value="" readonly/>
										    		<span class="add-on"><i class="fa fa-calendar"></i></span>
										 		</div>
												<label  class="col-sm-2 control-label">发行结束时间</label>
												<div class="col-sm-4 input-append date form_datetime">
										    		<input style="width:88%" id="form1_saleDateStart" data-name="trsSale.saleDateStart" name="trsSale.saleDateStart" type="text" class="form-control datepicker" value="" readonly/>
										    		<span class="add-on"><i class="fa fa-calendar"></i></span>
										 		</div>
											</div>
											<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">票面利率</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">票面利率选择权</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                <!-- 	<div class="form-group col-sm-12">
												<label  class="col-sm-4 control-label">额度管理级别</label>
												<div class="col-sm-8">
						                			<select id="addForm1_trpProduct_proLevel" name="trpProduct.proLevel" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=lcLevel" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div> -->
<!-- 						                	<div class="form-group col-sm-12"> -->
<!-- 												<label  class="col-sm-4 control-label">理财凭证</label> -->
<!-- 												<div class="col-sm-8"> -->
<!-- 						                			<select id="addForm1_trpProduct_proVoucher" name="trpProduct.proVoucher" class="form-control"  -->
<!-- 						                			data-url="doCode=dictItemList&cateEname=lcVoucher" data-colmun="" data-type="select"> -->
<!-- 						                			</select> -->
<!-- 												</div> -->
<!-- 											</div> -->
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">票面利率披露日</label>
													<div class="col-sm-4 input-append date form_datetime">
											    		<input style="width:88%" id="form1_saleDateStart" data-name="trsSale.saleDateStart" name="trsSale.saleDateStart" type="text" class="form-control datepicker" value="" readonly/>
											    		<span class="add-on"><i class="fa fa-calendar"></i></span>
											 		</div>
												<label  class="col-sm-2 control-label">投资者回售选择权</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">回售登记期</label>
													<div class="col-sm-4 input-append date form_datetime">
											    		<input style="width:88%" id="form1_saleDateStart" data-name="trsSale.saleDateStart" name="trsSale.saleDateStart" type="text" class="form-control datepicker" value="" readonly/>
											    		<span class="add-on"><i class="fa fa-calendar"></i></span>
											 		</div>
												<label  class="col-sm-2 control-label">计息方式</label>
												<div class="col-sm-4">
													<select style="width:300px; text-align: center;" class="form-control clean">
														<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
														<option>单息</option>
														<option>复息</option>
													</select>
												</div>
											</div>
											<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">还本付息方式</label>
												<div class="col-sm-4">
														<select style="width:300px; text-align: center;" class="form-control clean">
															<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
															<option>一次还本付息</option>
															<option>分期付息</option>
														</select>
												</div>
												<label  class="col-sm-2 control-label">付息日和本金兑付日</label>
														<div class="col-sm-4 input-append date form_datetime">
												    		<input style="width:88%" id="form1_saleDateStart" data-name="trsSale.saleDateStart" name="trsSale.saleDateStart" type="text" class="form-control datepicker" value="" readonly/>
												    		<span class="add-on"><i class="fa fa-calendar"></i></span>
												 		</div>
												
											</div>
											<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">担保措施</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">担保方式</label>
												<div class="col-sm-4">
														<select style="width:300px; text-align: center;" class="form-control clean">
															<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
															<option>保证</option>
															<option>抵押</option>
															<option>留置</option>
															<option>质押</option>
															<option>定金</option>
														</select>
												</div>
											</div>
											<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">受托管理人</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">承销方式</label>
												<div class="col-sm-4">
														<select style="width:300px; text-align: center;" class="form-control clean">
															<option value="" selected="selected" style="font: inherit; ">--请选择--</option>
															<option>代销</option>
															<option>包销</option>
														</select>
												</div>
											</div>
											<div class="form-group col-sm-12">
												<label  class="col-sm-2 control-label">资金用途</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
												<label  class="col-sm-2 control-label">税务提示</label>
												<div class="col-sm-4">
														<input type="text" id="addForm1_trpProduct_proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<!-- <div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">用户名称</label>
												<div class="col-sm-8">
						                			<select id="addForm1_trpProduct_userId" name="trpProduct.userId" class="form-control" 
						                			data-url="doCode=dymicSql&modelTypes=s_member" data-colmun="{value:'memberId',text:'memberCname',other:'memberEname'}" data-type="select">
						                			</select>
												</div>
											</div> -->
								        <!--trpProduct end-->
								        
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
												<button class="btn btn-success " type="button" onclick="submitForm1('addForm1','0');"> 保存 </button>
				                				<button class="btn btn-danger " type="button" onclick="submitForm1('addForm1','1');"> 提 交 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>	
			                
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>  

<div win-title="修改窗口" class="modal fade" id="my_modal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:900px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">信息修改</font> 
						</h4>
					</div>
					<div class="modal-body">
						 <div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="myTab-edit">
					            </ul>
					            
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					               <div class="tab-pane active" id="tabEdit_1">
					                  <form class="form-horizontal editFormBody" role="form" id="editForm1" action="javascript:void(0)">
					                    <input type="hidden" name="pageName" value="financial-reg-list"/>
										<input type="hidden" name="formName" value="editForm"/>
									    <input type="hidden" class="formToken" id="editForm1_formToken" name="formToken" />
									    <input type="hidden" class="clean" id="editForm1_trpProduct_proId" name="trpProduct.w_proId" data-name="trpProduct.proId"/>
					 					<input type="hidden" name="trpProduct.proStatus" value="1">       			
										
							            <!--trpProduct start-->
										<input type="hidden" class="clean" data-name="trpProduct.cateName" name="trpProduct.cateName" id="editForm1_trpProduct_cateName" value=""><!--所属品种-->
										<input type="hidden" class="clean" data-name="trpProduct.cateNo" name="trpProduct.cateNo" id="editForm1_trpProduct_cateNo" value=""><!--品种编号-->
										<input type="hidden" class="clean" data-name="trpProduct.proType" name="trpProduct.proType" id="editForm1_trpProduct_proType" value=""><!--产品类型-->
					        			<input type="hidden" class="clean" data-name="trpProduct.proId" name="trpProduct.w_proId" id="editForm1_trpProduct_w_proId" value=""><!--this is trpProduct primaryKeyId 主键-->
										<input type="hidden" class="clean" data-name="trpProduct.proId" name="trpProduct.proId" id="editForm1_trpProduct_proId" value=""><!--主键-->
										<input type="hidden" class="clean" data-name="trpProduct.sysName" name="trpProduct.sysName" id="editForm1_trpProduct_sysName" value="${sysName }"><!--所属系统-->
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品名称</label>
												<div class="col-sm-8">
														<input type="text" id="editForm1_trpProduct_proName" data-name="trpProduct.proName" name="trpProduct.proName" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品代码</label>
												<div class="col-sm-8">
														<input type="text" id="editForm1_trpProduct_proNo" data-name="trpProduct.proNo" name="trpProduct.proNo" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品描述</label>
												<div class="col-sm-8">
										  			<textarea class="form-control clean" rows="3" data-name="trpProduct.proRemark" id="editForm1_trpProduct_proRemark" name="trpProduct.proRemark"  maxLength="2000" placeholder="最多输入2000字"  data-type="textarea" ></textarea>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">品种类型</label>
												<div class="col-sm-8">
						                			<select id="editForm1_trpProduct_cateId" onchange="changeSelectTo('editForm1_trpProduct_cateId','editForm1_trpProduct_cateNo','editForm1_trpProduct_cateName')" data-name="trpProduct.cateId" name="trpProduct.cateId" class="form-control" 
						                			data-url="doCode=dymicSql&modelTypes=s_trpCate" data-colmun="{value:'cateId',text:'cateName',other:'cateNo,cateType'}" data-type="select">
						                			</select>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">额度管理级别</label>
												<div class="col-sm-8">
						                			<select id="editForm1_trpProduct_proLevel" data-name="trpProduct.proLevel" name="trpProduct.proLevel" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=lcLevel" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">理财凭证</label>
												<div class="col-sm-8">
						                			<select id="editForm1_trpProduct_proVoucher" data-name="trpProduct.proVoucher" name="trpProduct.proVoucher" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=lcVoucher" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">理财方式</label>
												<div class="col-sm-8">
						                			<select id="editForm1_trpProduct_proMode" data-name="trpProduct.proMode" name="trpProduct.proMode" class="form-control" 
						                			data-url="doCode=dictItemList&cateEname=lcMode" data-colmun="" data-type="select">
						                			</select>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">渠道</label>
												<div class="col-sm-8">
														<input type="text" id="editForm1_trpProduct_proCanal" data-name="trpProduct.proCanal" name="trpProduct.proCanal" class="form-control clean"  placeholder="必填项" />
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">用户名称</label>
												<div class="col-sm-8">
						                			<select id="editForm1_trpProduct_userId" data-name="trpProduct.userId" name="trpProduct.userId" class="form-control" 
						                			data-url="doCode=dymicSql&modelTypes=s_member" data-colmun="{value:'memberId',text:'memberCname',other:'memberEname'}" data-type="select">
						                			</select>
												</div>
											</div>
								       <!--trpProduct end-->
								       
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
												<button class="btn btn-success pull-left" type="button" onclick="mytools.closeModal('my_modal_edit');"> 取消 </button>
				                				<button class="btn btn-danger pull-right" type="button" onclick="submitForm1('editForm1','1');"> 提 交 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>	
					</div>
				</div>
				<!-- /.modal-content -->
	</div>		
</div>  

<div win-title="查看窗口" class="modal fade" id="my_modal_view" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:900px;">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">查看详情</font> 
						</h4>
					</div>
					<div class="modal-body">
						<div class="nav-tabs-custom">
					            <ul class="nav nav-tabs" id="myTab-view">
					            </ul>
					            
					            <!-- tab content start -->
					            <div class="tab-content">
					            
					               <div class="tab-pane active" id="tabView_1">
					                  <form class="form-horizontal" role="form" id="viewForm1" action="javascript:void(0)">
							            <!--trpProduct start-->
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品名称</label>
												<div class="col-sm-8">
													<span data-name="trpProduct.proName"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品代码</label>
												<div class="col-sm-8">
													<span data-name="trpProduct.proNo"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">产品描述</label>
												<div class="col-sm-8">
													<span data-name="trpProduct.proRemark"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">品种类型</label>
												<div class="col-sm-8">
						                			<span data-name="trpProduct.cateName" data-dict-url="doCode=dymicSql&modelTypes=s_trpCate"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">额度管理级别</label>
												<div class="col-sm-8">
						                			<span data-name="trpProduct.proLevel" data-dict-url="doCode=dictItemList&cateEname=lcLevel"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">理财凭证</label>
												<div class="col-sm-8">
						                			<span data-name="trpProduct.proVoucher" data-dict-url="doCode=dictItemList&cateEname=lcVoucher"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">理财方式</label>
												<div class="col-sm-8">
						                			<span data-name="trpProduct.proMode" data-dict-url="doCode=dictItemList&cateEname=lcMode"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">渠道</label>
												<div class="col-sm-8">
													<span data-name="trpProduct.proCanal"></span>
												</div>
											</div>
						                	<div class="form-group col-sm-10">
												<label  class="col-sm-4 control-label">用户名称</label>
												<div class="col-sm-8">
						                			<span data-name="trpProduct.userId" data-dict-url="doCode=dymicSql&modelTypes=s_member"></span>
												</div>
											</div>
								       <!--trpProduct end-->
								       
					                    
					                    <div class="form-group">
								        	<div class="col-sm-12">
									         <div class="box-footer text-center">
												<button class="btn btn-success pull-right" type="button" onclick="mytools.closeModal('my_modal_view');"> 关闭 </button>
					            			</div>
				            				</div>
				            			</div>
					                  </form>
					               </div>
					          
				            </div>
					            <!-- tab content e -->
				          </div>
					</div>
				</div>
				<!-- /.modal-content -->
	</div>		
</div>
</body>


<!-- Part 二、以下是template模板定义的模块区域 -->
<script type="text/template" id="dataList-template">
		<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
					<td><?=strUtil.doNull(rows[i].proName,'')?></td>
					<td><?=strUtil.doNull(rows[i].proNo,'')?></td>
					<td><?=strUtil.doNull(rows[i].cateName,'')?></td>
					<td><?=strUtil.doNull(rows[i].proCanal,'')?></td>
					<td><?=strUtil.doNull(rows[i].proRemark,'')?></td>
              <td>	
					<? if("0" == rows[i].proStatus){ ?>
					<button type="button" class="btn btn-success btn-xs" onclick="toLoad('<?=rows[i].proId?>','view')">查看</button>  
					<button type="button" class="btn btn-warning btn-xs" onclick="toLoad('<?=rows[i].proId?>','edit');">修改</button>  
					<button type="button" class="btn btn-danger btn-xs" onclick="toDele('<?=rows[i].proId?>');">删除</button>
					<? }else{?>
					<button type="button" class="btn btn-success btn-xs" onclick="toLoad('<?=rows[i].proId?>','view')">查看</button>  
					<button type="button" class="btn btn-default btn-xs" disabled="disabled">已提交审核</button> 
					<? }?> 
				</td>
		</tr>
   <?}?>  		
</script>

</html>

<!-- Part 三、 以下是js模块区域 -->
<script>
var clickMenu = "private-placement-list";
var myPage,dataListId,searchFormId,mainObj,mainId;
myPage = 10;//定义列表数据
dataListId = "dataList";//显示列表数据div的id
searchFormId = "searchForm";//搜索表单Id
mainObj = "trpProduct";//主对象
mainId = "proId";//主对象主键

$(function () {
	//1、加载分页列表数据
	getTableData();
	
	//2、控制是否启用token
	//setToken();
	
	//可在下面补充其他初始化方法（如数据字典、页面加载数据等）
	
 });
 
 $(function () {
	//设置数据行选中效果
	$('#'+dataListId+' tbody').on('click','tr', function (e) {
	     if ( $(this).hasClass('selected') ) {
	        }
	        else {
	            $('tr.selected').removeClass('selected');
	            $(this).addClass('selected');
	        }
	     //var id = $('tr.selected th').eq(0).html();
	} );
 });
//日历框添加样式
var dateObject = $('.datepicker').datepicker( {
	language : 'zh-CN',
	//inline: true,
	todayBtn : "linked",
	format : "yyyy-mm-dd",
	autoclose: true
});
//打开添加页面
function toAdd(){
	mytools.cleanData(".addFormBody");//清空表单元素上次填写的内容；
	setValidate(".addFormBody");//定义add表单验证属性
	mytools.cleanValidate(".addFormBody");//清空上次校验规则提示
	$(".datepicker").val("");
	//初始化数据字典
	DictUtil.getCommonDictData("select","#addForm1_trpProduct_cateId","trpProduct.cateId","doCode=dymicSql&modelTypes=s_trpCate&trpCate.w_cateId=d9831983c51c400e83ce973779d2abb3","{value:'cateId',text:'cateName',other:'cateNo,cateType'}","");
	DictUtil.getCommonDictData("select","#addForm1_trpProduct_proLevel","trpProduct.proLevel","doCode=dictItemList&cateEname=lcLevel","","");
	DictUtil.getCommonDictData("select","#addForm1_trpProduct_proVoucher","trpProduct.proVoucher","doCode=dictItemList&cateEname=lcVoucher","","");
	DictUtil.getCommonDictData("select","#addForm1_trpProduct_proMode","trpProduct.proMode","doCode=dictItemList&cateEname=lcMode","","");
	DictUtil.getCommonDictData("select","#addForm1_trpProduct_userId","trpProduct.userId","doCode=dymicSql&modelTypes=s_member","{value:'memberId',text:'memberCname',other:'memberEname'}","");
	$('#my_modal_add').modal('show');
}
//数据toLoad读取（查询、编辑）数据
function toLoad(id,type){
	var formName = $("#searchForm").find("input[name='formName']").val();
	var paramLoadData = {"pageName":"financial-reg-list","formName":formName,"trpProduct.w_proId":id};
	showModal(type);//控制弹出view/edit窗口
	$.ajax({
	    type:'get',
	   	url:common_info_url,
	    data: paramLoadData,
	    async:false,
	    dataType:"json",
	    success: function(myData){
	    	console.log(myData);
	    	//反显加载数据
			FormUtil.loadView("trpProduct", myData);
			if("edit"==type){		
				DictUtil.getCommonDictData("select","#editForm1_trpProduct_cateId","trpProduct.cateId","doCode=dymicSql&modelTypes=s_trpCate","{value:'cateId',text:'cateName',other:'cateNo,cateType'}",myData.cateId);
				DictUtil.getCommonDictData("select","#editForm1_trpProduct_proLevel","trpProduct.proLevel","doCode=dictItemList&cateEname=lcLevel","",myData.proLevel);
				DictUtil.getCommonDictData("select","#editForm1_trpProduct_proVoucher","trpProduct.proVoucher","doCode=dictItemList&cateEname=lcVoucher","",myData.proVoucher);
				DictUtil.getCommonDictData("select","#editForm1_trpProduct_proMode","trpProduct.proMode","doCode=dictItemList&cateEname=lcMode","",myData.proMode);
				DictUtil.getCommonDictData("select","#editForm1_trpProduct_userId","trpProduct.userId","doCode=dymicSql&modelTypes=s_member","{value:'memberId',text:'memberCname',other:'memberEname'}",myData.userId);
			}
	  	}
	});
}
//删除调用
function toDele(id){
	var index_submit = layer.confirm('您确定要删除信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		var paramData = {"pageName":"financial-reg-list","formName":"delForm","trpProduct.w_proId":id};
		$.ajax({
	    	type:"post",
	    	url:common_submit_url,
	    	data: paramData,dataType:"json",
	    	success: function(myData){
	    		var result = myData.flag;
	    		if(result=="T"){
	    			refresh();
	    		}else{
	    			layer.alert("删除失败！");
	    		}
	  		}
		});	
	});
}
//弹出框
function showModal(type){
	if("view"==type){
		$("#my_modal_view").modal("show");
	}else if("edit"==type){
		mytools.cleanData(".editFormBody");//清空表单元素上次填写的内容；
		setValidate(".editFormBody");//定义edit表单验证属性
		mytools.cleanValidate(".editFormBody");//清空上次校验规则提示
		$("#my_modal_edit").modal("show");
	}
}
//加载列表数据
function getTableData(){
	deleteAllRow(dataListId);
	$.ajax({
		   type:'get',
		   url:common_list_url,
		   data:$("#"+searchFormId).serialize()+getCurrentPage(common_list_url+"?"+$("#"+searchFormId).serialize(),myPage),
		   dataType:'json',
		   success: function(myData){
		   console.log(myData);
			var data = baidu.template(dataListId+"-template",eval(myData));  
			$("#"+dataListId+"-body").html(data);
			  var option= {
					   ele:$("#"+dataListId+"-page")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$("#"+searchFormId).serialize()
				   }
				generatePages(option);
		   }
		});	
  }


//提交tab1表单数据
function submitForm1(formId,type){
	//校验规则-表单提交时触发
	var validate = $('#'+formId).data('bootstrapValidator').validate();
	if(!validate.isValid()){ //如果校验不通过就返回
	    return;  
	}
	if('0'==type){
	alert(type);
		$("#trpProductId").val(0);
	}
	if('1'==type){
	alert(type);
		$("#trpProductId").val(1);
	}
	var index_submit = layer.confirm('您确定要保存信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		var result = submitForm(formId);
		if(result){
      		layer.alert('操作成功！', {closeBtn: 0 });
      		mytools.closeModal("my_modal_add");
      		mytools.closeModal("my_modal_edit");
      		refresh();
		
    		var num = formId.slice(-1);
    		if(num!=null &&　num !=""){
    			num=parseInt(num)+1;
    			defaultTab = "#tab_"+num;
    		}
      		//setToken();
      		//if(tabId!=null && tabId!=""){
      		//	tabId = "#"+tabId;
      		//	$('#myTab a[href=\"'+tabId+'\"]').tab('show'); // Select tab by name 
      		//}
	  	}
	});
	
 }
//提交表单数据
function submitForm(formId){
	var result;
	/* if(tabId!=null && tabId!="" && tabId!="undefined"){
	}else{
		var proName = $("#"+formId+"_proName").val();
	} */
	var index_load = layer.load(1, {shade: false});
	$.ajax({
	    type:'post',
	    url:common_submit_url,
	    data:$("#"+formId).serialize(),
	    async:false,
	    dataType:'json',
	    success: function(myData){ 
	     console.log(myData);
	        if(myData.flag=="T"){
	        	result = myData;
	    	}else{
	    		setToken();
	     		layer.alert(myData.msg);
	    	}
	        layer.close(index_load);
	  	},
	     error: function (e) {
		     layer.close(index_load);
     	} 
	});	
	return result;
}

//刷新
function refresh(){
	getTableData();
}
//设置token
function setToken(){
	$.ajax({
	    type:'get',
	    url:'${ctx}/sendPage/token?token=true',
	    dataType:'text',
	    success: function(myData){
	    	console.log(myData);
			$('.formToken').val(myData);
	  	}
	});	
}


/**** Part 四、以下是自定义新增方法  ****/
//1.定义校验规则-定义
function setValidate(id){
	$(id).bootstrapValidator({
	    feedbackIcons: {
	        valid: 'glyphicon glyphicon-ok',
	        invalid: 'glyphicon glyphicon-remove',
	        validating: 'glyphicon glyphicon-refresh'
	    },/** 以下需要结合实际业务清空补充个表单元素的验证规则 **/
	    fields: {
	        "trpProduct.proName": {
	            validators: {
	                notEmpty: {
	                    message: '自定义属性不能为空！'
	                }
	            }
	        }
	    }
	});
}


function changeSelectTo(cateId,cateNoId,cateNameId){
	var cateNoValue=$("#"+cateId).find("option:selected").attr("cate-no");
	var cateNameValue=$("#"+cateId).find("option:selected").text();
	$("#"+cateNoId).val(cateNoValue);
	$("#"+cateNameId).val(cateNameValue);
}

</script>



